<!DOCTYPE html>
<html>

<head lang="en">
    <title>我的订单</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/bootstrap-4.1.1-dist/css/bootstrap.min.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="/css/reset.css"/>
    <link rel="stylesheet" href="/css/strategy.css"/>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css"/>

    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <script src="/js/common.js"></script>
    <script src="/js/plugins/dialog2/dialog.min.js"></script>



    <style>
        #left {
            background-color: red;
            float: left;
            width: 50%;
        }
        #right {
            background-color: greenyellow;
            float: right;
            width: 50%;
        }

        /* 禁用iPhone中Safari的字号自动调整 */
        html {
            -webkit-text-size-adjust: 100%;
            -ms-text-size-adjust: 100%;
            /* 解决IOS默认滑动很卡的情况 */
            -webkit-overflow-scrolling : touch;
        }

        /* 禁止缩放表单 */
        input[type="submit"], input[type="reset"], input[type="button"], input {
            resize: none;
            border: none;
        }

        /* 取消链接高亮  */
        body, div, ul, li, ol, h1, h2, h3, h4, h5, h6, input, textarea, select, p, dl, dt, dd, a, img, button, form, table, th, tr, td, tbody, article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
        }

        /* 设置HTML5元素为块 */
        article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
            display: block;
        }

        /* 图片自适应 */
        img {
            width: 100%;
            height: auto;
            width: auto\9; /* ie8 */
            display: block;
            -ms-interpolation-mode: bicubic;/*为了照顾ie图片缩放失真*/
        }

        /* 初始化 */
        body, div, ul, li, ol, h1, h2, h3, h4, h5, h6, input, textarea, select, p, dl, dt, dd, a, img, button, form, table, th, tr, td, tbody, article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
            margin: 0;
            padding: 0;
        }
        body {
            font: 12px/1.5 'Microsoft YaHei','宋体', Tahoma, Arial, sans-serif;
            color: #555;
            background-color: #F7F7F7;
        }
        em, i {
            font-style: normal;
        }
        ul,li{
            list-style-type: none;
        }
        strong {
            font-weight: normal;
        }
        .clearfix:after {
            content: "";
            display: block;
            visibility: hidden;
            height: 0;
            clear: both;
        }
        .clearfix {
            zoom: 1;
        }
        a {
            text-decoration: none;
            color: #969696;
            font-family: 'Microsoft YaHei', Tahoma, Arial, sans-serif;
        }
        a:hover {
            text-decoration: none;
        }
        ul, ol {
            list-style: none;
        }
        h1, h2, h3, h4, h5, h6 {
            font-size: 100%;
            font-family: 'Microsoft YaHei';
        }
        img {
            border: none;
        }
        input{
            font-family: 'Microsoft YaHei';
        }
        /*单行溢出*/
        .one-txt-cut{
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }
        /*多行溢出 手机端使用*/
        .txt-cut{
            overflow : hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            /* -webkit-line-clamp: 2; */
            -webkit-box-orient: vertical;
        }
        /* 移动端点击a链接出现蓝色背景问题解决 */
        a:link,a:active,a:visited,a:hover {
            background: none;
            -webkit-tap-highlight-color: rgba(0,0,0,0);
            -webkit-tap-highlight-color: transparent;
        }
        .w50{
            width: 50%;
        }
        .w25{
            width: 25%;
        }
        .w20{
            width: 20%;
        }
        .w33{
            width: 33.333333%;
        }
        .fl{
            float: left;
        }
        .fr{
            float: right;
        }
        .db{
            display: block !important;
        }
        .dn{
            display: none;
        }
        .border{
            border: 1px solid transparent;
        }
    </style>

</head>

<body>
<div class="search-head">
    <!--<div class="bk21" id="mess_box" style="overflow-y:auto;overflow:scroll; position:absolute;top=0px; left:0px;">-->
    <div class="row nav-search" style="background-color: black">
        <div class="col-12">
            <a href="/mine/profiles.html">
                <span class="headInfo"><i class="fa fa-chevron-left fa-1x"></i>
                    返回
                </span>
                <span style="text-align: center;font-size: 20px">我的订单</span>
            </a>
        </div>
    </div>
</div>
<div>
    <center>
    <span  style="font-size: 10px;background-color:grey">关于订单您有任何问题,请拨打客服电话 400-123-3579</span>
    </center>
</div>



<div class="tab-content" id="pills-tabContent">
    <div class="tab-pane fade active show" id="pills-top">
        <hr>
        <div class="container strategyCommend ">
            <div class="row hot">
                <div class="col-4">
                    <span>我的订单</span><br/>
                <a role="button" class="payBtn" >
                    <img src="/upload/6610317b-2077-4bd3-98c7-7d31b6613469.jpg">
                </a>
                 </div>
                <div class="col-8" >
                    <a role="button" class="payBtn">
                        <p style="text-align: left">订单编号:<span>122-45-6556</span></p>
                        <p style="text-align: left">商品名称:<span>黄金荣加厚保暖内衣</span></p>
                        <p style="text-align: left">价格:<font color="red">$1300</font></p>
                        <p style="text-align: left">状态:<span>卖家已付款</span></p>
                    </a>
                        <button type="button"  class="btn btn-info btn-sm">再次购买</button>

                </div>
                <br/>
                <HR style="FILTER: alpha(opacity=100,finishopacity=0,style=3)" width="80%" color=#987cb9 SIZE=3>

            </div>

        </div>
    </div>
</div>

<script>
    $(function () {
        $("#pills-top-tab2").click(function () {
            console.log(1);
        })

        var currentPage = 1;
        var pages;
        var user = JSON.parse(sessionStorage.getItem("user"));
        //剩余积分
        var store = [];

        //界面显示
        function query() {
            $.get("/integralStores", {currentPage: currentPage, pageSize: 6}, function (data) {
                $.merge(store, data.list);
                var datas = {"list": store};
                $(".strategyCommend").renderValues(datas);
                pages = data.pages;
                //点击图片支付
                $(".payBtn").click(function () {
                    console.log($(this).data("id"));
                    //积分商品的id
                    var id = $(this).data("id");
                    //商品的信息
                    $.get("/integralStores/" + id, function (data) {
                        $(document).dialog({
                            type: 'confirm',
                            closeBtnShow: true,
                            content: '你确定要消耗' + data.productIntegral + "积分兑换" + data.product + "吗",
                            onClickConfirmBtn: function () {
                                console.log("这里是确定", id, user.id, data.productIntegral);
                                if(result>=data.productIntegral){
                                    $.post("/integralStores", {
                                        userId: user.id,
                                        productId: id,
                                        productIntegral: data.productIntegral
                                    }, function (data) {
                                        console.log(data.succeed);
                                        if (data.succeed ) {
                                            $(document).dialog({
                                                titleText: '温馨提示',
                                                content: '兑换成功',
                                            })
                                            setTimeout(function () {
                                                window.location.reload()
                                            }, 1000)
                                        }
                                    });
                                }else {
                                    $(document).dialog({
                                        titleText: '温馨提示',
                                        content: '积分不足',
                                    })
                                }


                            },
                            onClickCancelBtn: function () {
                            },
                        });
                    })
                })
            });
            currentPage++;
        }

        query();
        //滚动条事件
        $(window).scroll(function () {
            //页面滑动查询
            if (($(window).height() + $(document).scrollTop()) >= $(document).height() - 1) {
                if (currentPage <= pages) {
                    query();
                } else {
                    $(document).dialog({
                        type: 'notice',
                        infoText: '已经到底了',
                        autoClose: 1000,
                        position: 'bottom'  // center: 居中; bottom: 底部
                    });
                }
            }
        });

    })

</script>
</body>

</html>